package net.lainiao.service.service;

import net.lainiao.base.model.ReptileFilter;
import net.lainiao.service.dao.ReptileFilterMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/1/9.
 */
@Service
public class ReptileFilterService {
    @Resource
    private ReptileFilterMapper reptileFilterMapper;

    public List<ReptileFilter> getListForTid(int tid){
        return reptileFilterMapper.getListForTid(tid);
    }

    public int delete(int id){
        return reptileFilterMapper.deleteByPrimaryKey(id);
    }

    public ReptileFilter getInfo(int id){
        return reptileFilterMapper.selectByPrimaryKey(id);
    }

    public int save(ReptileFilter reptileFilter){
        if(reptileFilter.getId()==null){
            return reptileFilterMapper.insert(reptileFilter);
        }
        return reptileFilterMapper.updateByPrimaryKey(reptileFilter);
    }

    public List<ReptileFilter> selectALL() {
        return reptileFilterMapper.selectAll();
    }
}
